package com.witframework.web.tree;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author wuxinyang
 * May 13, 2009 11:53:37 AM
 *
 */
public class TreeItem {
	private String id;
	private String text;
	private String tooltip;
	private int child=0;
	private boolean checkbox=false;	
	private boolean open=false;
	private boolean call=false;
	private boolean select=false;
	private String img0;
	private String img1;
	private String img2;
	
	private List<TreeItem> childItems=new ArrayList<TreeItem>();
	private List<TreeUserdata> treeUserdatas=new ArrayList<TreeUserdata>();

	public TreeItem(String id,String text){
		this.id=id;
		this.text=text;
	}
	public void addChildItem(TreeItem treeItem){
		childItems.add(treeItem);
	}
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		if(text==null)
			return this.id;
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public int getChild() {
		return child;
	}

	public void setChild(int child) {
		this.child = child;
	}



	public boolean isCheckbox() {
		return checkbox;
	}
	public void setCheckbox(boolean checkbox) {
		this.checkbox = checkbox;
	}	

	public boolean isOpen() {
		return open;
	}

	public void setOpen(boolean open) {
		this.open = open;
	}

	public boolean isCall() {
		return call;
	}

	public void setCall(boolean call) {
		this.call = call;
	}

	public boolean isSelect() {
		return select;
	}

	public void setSelect(boolean select) {
		this.select = select;
	}
	public List<TreeItem> getChildItems() {
		return childItems;
	}

	public void addUserdata(TreeUserdata ud){
		treeUserdatas.add(ud);
	}
	public List<TreeUserdata> getTreeUserdatas() {
		return treeUserdatas;
	}
	public void setTreeUserdatas(List<TreeUserdata> treeUserdatas) {
		this.treeUserdatas = treeUserdatas;
	}
	public void setTooltip(String tooltip) {
		this.tooltip = tooltip;
	}
	public String getTooltip() {
		return tooltip;
	}
	
	public String getImg0() {
		return img0;
	}
	public void setImg0(String img0) {
		this.img0 = img0;
	}
	public String getImg1() {
		return img1;
	}
	public void setImg1(String img1) {
		this.img1 = img1;
	}
	public String getImg2() {
		return img2;
	}
	public void setImg2(String img2) {
		this.img2 = img2;
	}
}
